<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php echo $css; ?>
<?php echo $js; ?>
</head>

<body>

<!-- wrap -->
<div class="wrap home">

<!-- header -->
<div class="header">
    <a href="<?php echo base_url(); ?>" class="logo"><?php echo $appname; ?></a>
    <ul class="topbar">
        <?php if($validUser){ ?>
        <li><?php echo $greeting; ?>，<?php echo $groupname; ?> <b class="username"><?php echo $username; ?></b></li>
        <?php if( chk_permission( 'info' ) ){ ?><li><a href="<?php my_url('userinfo'); ?>">信息管理</a></li><?php } ?>
        <?php if( chk_permission( 'setting' ) ){ ?><li><a href="<?php my_url('setting'); ?>">账户设置</a></li><?php } ?>
        <li><a href="<?php echo my_url('logout'); ?>">退出</a></li>
        <?php } else { ?>
        <li><a href="<?php echo my_url('login'); ?>">登录</a></li>
        <li><a href="<?php echo my_url('register'); ?>">免费注册</a></li>
        <?php } ?>
    </ul>
    <ul class="nav">
        <?php foreach( $navigation as $single ) { ?>
        <li><a href="<?php echo $single['url']; ?>"<?php if($single['active']){ ?> class="active"<?php } ?>><?php echo $single['title']; ?></a></li>
        <?php } ?>
    </ul>
    <div class="c"></div>
</div>
<!-- header -->